package me.zhengjie.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author 18485
 */
@Getter
@Setter
@TableName("tool_flow_config")
public class FlowConfig extends BaseEntity implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value = "ID", hidden = true)
    private Long id;

    @NotNull
    @ApiModelProperty(value = "流程名称")
    private String flowName;

    @NotNull
    @ApiModelProperty(value = "流程ID")
    private String flowId;

    @ApiModelProperty(value = "流程标识")
    private String flowKey;

    @NotNull
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "原始数据")
    private String orginalData;

    public void copy(FlowConfig source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
